package com.neuronbit.businessflow.intellij.psi;

import com.neuronbit.businessflow.intellij.lang.BpmParserDefinition;
import com.intellij.codeInsight.completion.*;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.patterns.PlatformPatterns;
import com.intellij.util.ProcessingContext;
import org.jetbrains.annotations.NotNull;

/**
 * The type Simple completion contributor.
 */
public class SimpleCompletionContributor extends CompletionContributor {
    /**
     * Instantiates a new Simple completion contributor.
     */
    SimpleCompletionContributor() {
        extend(CompletionType.BASIC,
                PlatformPatterns.psiElement(BpmParserDefinition.STRING.getTypes()[0]),
                new CompletionProvider<>() {
                    public void addCompletions(@NotNull CompletionParameters parameters,
                                               @NotNull ProcessingContext context,
                                               @NotNull CompletionResultSet resultSet) {
                        resultSet.addElement(LookupElementBuilder.create("Hello"));
                    }
                }
        );
    }
}
